<div class="wrap">
  <div class="wrap-content" *ngIf="conentFlag">
    <div *ngFor="let item of deliveryplan; let i = index">
      <div *ngIf="item.reportType != 'productdeliverytype_180208000015'" [ngClass]="{'m-t-20':i>0}">
        <p-panel headerClass="bg-none" [showScroll]="false">
          <p-header>
            <div class="text-right p-6-0">
              <span class="border-l-1a8fe8 p-l-8 pull-left m-t-8 m-b-10"> 第{{item.sortNum}}批物料
                <span class="panel-status-success" *ngIf="storage.dicFilter('deliveryproductstatus',item.isReport)">
                  {{storage.dicFilter('deliveryproductstatus',item.isReport)}}
                </span>
              </span>
              <!-- <span class="p-l-8 pull-left  m-t-6" style="margin-top: 5px;">
                <p-label [label]="storage.dicFilter('deliveryproductstatus',item.isReport)" [active]="true" styleColor="#02bb5f" styleClass="m-r-20"
                  [showClose]=false></p-label>
              </span> -->
              <button pButton type="button" (click)="materialInfo(item.infoId,item.productCode)" label="查看物料" class="btn btn-secondary"></button>
              <button pButton type="button" (click)="punishments(item.id,item.isReport);"
                label="发起处罚" class="btn-secondary"></button>
            </div>
          </p-header>

          <div class="table-row">
            <div class="table-cell text-left width-110  color-b1b1b1">
              收货联系人：
            </div>
            <div class="table-cell">
              {{item.creater}}&nbsp;{{storage.dicFilter('user_type',item.userType)}}&nbsp;{{item.userTelePhone}}
            </div>
          </div>
          <div class="table-row">

            <div class="table-cell text-left width-110  color-b1b1b1">
              应到场时间：
            </div>
            <div class="table-cell">
              {{item.shouldArriveTime}}
            </div>
          </div>

          <div class="table-row">
            <div class="table-cell text-left width-110  color-b1b1b1">提报结果：</div>
          </div>
          <div></div>
          <div class="table-row">
            <div class="table-cell text-left">
              <!-- <p-dataTable [value]="item.deliveryResultList" [headerCheckboxToggleAllPages]="true">
                      <p-column *ngFor="let col of reportResultHead" [field]='col.field' [header]='col.header' [hidden]="col.hidden" [style]="{'width':col.width}">
                        <ng-template let-index="rowIndex" let-data="rowData" pTemplate="body" *ngIf="col.dic">
                          <span *ngIf="col.field == 'reportResult'"> {{data.reportResult}} </span>
                          <span *ngIf="col.field == 'creater'">{{data[col.field]}} &nbsp; {{storage.dicFilter(col.dic,data['userType'])}} </span>
                        </ng-template>
                        <ng-template let-index="rowIndex" let-data="rowData" pTemplate="body" *ngIf="col.tem">
                          <div *ngIf="col.field === 'sortNum'">
                            {{index+1}}
                          </div>
                        </ng-template>
                      </p-column>
                    </p-dataTable> -->
              <app-div-table [tableHead]="reportResultHead" [values]="item.deliveryResultList"></app-div-table>
            </div>
          </div>
        </p-panel>
      </div>
    </div>
    <div *ngFor="let item of supplementList; let i = index">
      <div [ngClass]="{'m-t-20':i>0}">
        <p-panel headerClass="bg-none" [showScroll]="false">
          <p-header>
            <div class="text-right p-6-0">
              <span class="border-l-1a8fe8 p-l-8 pull-left m-t-8 m-b-10"> 第{{item.sortNum}}批补货物料
                <span class="panel-status-success" *ngIf="storage.dicFilter('deliveryproductstatus',item.isReport)">
                  {{storage.dicFilter('deliveryproductstatus',item.isReport)}}
                </span>
              </span>
              <button pButton type="button" (click)="materialInfo(item.infoId,item.productCode)" label="查看物料" class="btn btn-secondary"></button>
              <button pButton type="button" (click)="punishments(item.id,item.isReport);"
                      label="发起处罚" class="btn-secondary"></button>
            </div>
          </p-header>

          <div class="table-row">
            <div class="table-cell text-left width-110  color-b1b1b1">
              收货联系人：
            </div>
            <div class="table-cell">
              {{item.creater}}&nbsp;{{storage.dicFilter('user_type',item.userType)}}&nbsp;{{item.userTelePhone}}
            </div>
          </div>
          <div class="table-row">

            <div class="table-cell text-left width-110  color-b1b1b1">
              应到场时间：
            </div>
            <div class="table-cell">
              {{item.shouldArriveTime}}
            </div>
          </div>

          <div class="table-row">
            <div class="table-cell text-left width-110  color-b1b1b1">提报结果：</div>
          </div>
          <div></div>
          <div class="table-row">
            <div class="table-cell text-left">
              <app-div-table [tableHead]="reportResultHead" [values]="item.deliveryResultList"></app-div-table>
            </div>
          </div>
        </p-panel>
      </div>
    </div>
    <p-dialog header="查看物料" *ngIf="materielFlag" [(visible)]="materielFlag" modal="modal" width="1000" [responsive]="true" (onHide)="selectedMaterielTypes = { 'name': '全部', 'code': 0 };">
      <div class="p-8-0">
          <div class="m-r-15 inline-block">
            <span class="opacity06">物料品类： </span>
            <div class="inline-block">
              <p-treeselect [value]="materielTypes" styleClass="width-220" [filter]="true" placeholder="全部" selectionMode="single"
                            [(selection)]="selectedMaterielTypes" (selectionChange)="searchCheck()"></p-treeselect>
            </div>
          </div>
          <div class="width-250 relative pull-right">
              <input type="text" pInputText class="width-full p-input p-r-28" [(ngModel)]="searchObj.searchValue" (keyUp.enter)="searchCheck()"
                placeholder="物料名称/编号"  maxlength="20">
              <span class="icon-search-right" (click)="searchCheck()" ></span>
            </div>
      </div>

        <p-dataTable [customWidth]="true"  scrollable="true" [value]="materielData" [totalRecords]="totalRecords" [lazy]="true" (onPage)="onPage($event)" scrollHeight="400px"
          [paginator]="true" [style]="{marginTop:'12px'}">
          <p-column *ngFor="let col of materielHead" [field]='col.field' [header]='col.header' [style]="{'width':col.width}">
            <ng-template let-index="rowIndex" let-data="rowData" pTemplate="body" *ngIf="col.tem">
              <div *ngIf="col.field === 'code'">
                {{data.code}}
              </div>
              <div *ngIf="col.field === 'sortNum'">
                {{index + 1}}
              </div>
            </ng-template>
          </p-column>
        </p-dataTable>
    </p-dialog>
  </div>
  <div class="wrap-content-none" *ngIf="conentNoFlag">
    <div class="bg-centent"></div>
    <p class="text-center">该项目施工模板匹配异常，请先去“模板管理”</p>
    <p class="text-center">中维护适用的施工模板，再重新匹配后即可正常派单</p>
  </div>
</div>


<!-- 处罚弹窗组件 -->
<app-list-punish-dialog *ngIf="isPunishShow" [data]="punishmentsData" [isShow]="isPunishShow" (changeIsShow)="changePunishShow($event)"></app-list-punish-dialog>
<!-- 处罚弹窗组件end -->
